<?php
require_once('Person.php');

class ContactRequest extends Person{
    	protected $dataDiv;
    	
	function __construct($peId, $viewerPeId){
	    	parent::__construct($peId, $viewerPeId);

		$this->arrangeData();
	}

	//the opt3 button is always shown. There won't be any requests pending from people (PeId) that the
	//viewer (viewerPeId) has in his already as theyr requests would automatically be processed.
	function arrangeData(){
	    switch ($this->generalPrivacy){
	    case 0:
	    	$this->dataDiv			= "<p>Nickname: ".$this->nickName."<br />
							 Name: ".$this->name."<br />
							 First Name: ".$this->firstName."<br />
							 email: ".$this->eMail;
		break;
	    case 1:
	    case 2:
	    case 3:
	    	$this->dataDiv			= "<p>Nickname: ".$this->nickName."<br />
							 Name: ".$this->name."<br />
							 First Name: ".$this->firstName."<br />
							 email: ".$this->eMail;
		break;
	    case 4:
	    	$this->dataDiv			= "<p>Nickname: ".$this->nickName."<br />
							 Name: ".$this->name."<br />
							 First Name: ".$this->firstName."<br />
							 email: ".$this->eMail."<br />
							 Twitter: www.twitter.com/".$this->twitterName;
		break;
	    }
	    $this->dataDiv			= $this->dataDiv."<form action=\"mycontacts.php\" method=\"post\">
							 <label for=\"opt3\">accept and add to your own contacts</label>
							 <input type=\"radio\" name=\"handle\" value=\"3\" id=\"opt3\">
							 <label for=\"opt1\">accept</label>
							 <input type=\"radio\" name=\"handle\" value=\"1\" id=\"opt1\">
							 <label for=\"opt2\">reject</label>
							 <input type=\"radio\" name=\"handle\" value=\"2\" id=\"opt2\">
							 <br />
							 <input type=\"hidden\" name=\"PEID\" value=\"".$this->peId."\" />
							 <input type=\"submit\" value=\"OK\">
						    </form>
						    </p>";
	}

	public function getDataDiv(){
	    	return $this->dataDiv;
	}
								//<!--<input type="radio" name="sex" value="male" /> Male<br />-->
}
?>
